package cn.js.sangu.unitStore.entity;

import cn.hutool.core.annotation.Alias;
import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

/**
 * 系统日志表
 * 作者：linshuo
 * 日期：2024/11/5 9:10
 */

@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
@TableName("logs")
public class Logs {

    @TableId(type = IdType.AUTO)
    private Integer id;

    @Alias("操作名称")
    private String operation;

    @Alias("操作类型")
    private String operaType;

    @Alias("操作人id")
    private Integer uid;

    @Alias("操作人名称")
    private String username;

    @Alias("用户IP地址")
    private String operaIp;

    @Alias("用户操作时间")
    @TableField(fill = FieldFill.INSERT)
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "Asia/Shanghai")
    private Date operaTime;

    @Alias("备注")
    private String remark;

}
